package com.huawei.hianalytics.util;

import android.annotation.TargetApi;
import android.content.Context;
import android.os.Build.VERSION;
import android.os.UserManager;
import com.huawei.hianalytics.a.b;

public class i {
    private static i a = new i();
    private boolean b = false;
    private Context c = b.n();

    private i() {
    }

    public static i a() {
        return a;
    }

    @TargetApi(24)
    public boolean b() {
        if (!this.b) {
            if (this.c == null) {
                return false;
            }
            if (VERSION.SDK_INT >= 24) {
                UserManager userManager = (UserManager) this.c.getSystemService("user");
                if (userManager != null) {
                    this.b = userManager.isUserUnlocked();
                } else {
                    this.b = false;
                }
            } else {
                this.b = true;
            }
        }
        return this.b;
    }
}
